package com.lyl.controller;

import com.lyl.entity.User;
import com.lyl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
//@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/user")
    public String findUserById(Model model) {
        final User userById = userService.findUserById(1);
        model.addAttribute("user",userById);
        return "index";
    }
}
